// 4
package main

import (
	"fmt"
)

func main() {
	p := 0
	for i := 100; i < 1000; i++ {
		for j := i; j < 1000; j++ {
			if isPalindromic(i*j) && i*j > p {
				p = i * j
			}
		}
	}
	fmt.Println(p)
}

func isPalindromic(n int) bool {
	s, l := make([]int, 6), 0
	for n != 0 {
		s[l] = n % 10
		n /= 10
		l++
	}
	for i := 0; i < (l+1)/2; i++ {
		if s[i] != s[l-i-1] {
			return false
		}
	}
	return true
}
